﻿using RayDen.Library.Components.Surface;
using RayDen.Library.Core;
using RayDen.Library.Core.Primitives;
using RayDen.RayEngine.Core.Surface;

namespace RayDen.RayEngine.Core.Types {




    public struct IntersectionData {
        public RayHit Hit;
        public SurfaceGeometryData SurfaceGeometry;
        public SurfaceTextureData SurfaceTexture;
        public VolumeHitData VolumeData;

    }


    public class SurfaceIntersectionData {
        public UV TexCoords;
        public Vector DpDu, DpDv;
        public Normal Normal, DnDu, DnDv;
        public Normal ShadingNormal;
        public ISurfaceMaterial MMaterial;


        public BxDFBase Brdf;
        public SampledSpectrum Reflectance;
        public RayHit Hit;
        public SurfaceTextureData TextureData;
        public RgbSpectrum Color;
        public RgbSpectrumInfo Alpha;
        public float Lambda;
        public BsdfEvent CurrentEvent, PreviousEvent;

        public VolumeHitData VolumeData;

        public bool isLight, isVolume;

        public SurfaceIntersectionData(ref RayHit hit, bool islight, bool volume=false) {
            this.Hit = hit;
            this.isLight = islight;
            this.isVolume = volume;
        }

        public bool IsLight {
            get { return isLight; }
        }
    }
}